Skip to content

ci: add lint and typecheck workflow (closes #147)#369

Open
Aymericr wants to merge 2 commits into
mainfrom
ci/lint-typecheck-cleanup
Open

ci: add lint and typecheck workflow (closes #147)#369
Aymericr wants to merge 2 commits into
mainfrom
ci/lint-typecheck-cleanup

Conversation

@Aymericr
Copy link
Copy Markdown
Contributor

@Aymericr Aymericr commented Jun 3, 2026

Adds the CI workflow contributors have been asking for, and resolves the lint/typecheck blockers that were preventing it from being added cleanly.

Closes #147.

What's in the workflow

.github/workflows/ci.yml runs bun run check (Biome lint + format) and bun run check-types (TypeScript) on every push and PR to main. Concurrency groups cancel stale runs.

What had to be cleaned up first

bun run check had 4 lint errors and bun run check-types had 32 errors on main — merging the workflow without fixing those would have blocked every subsequent push.

Lint (4 errors → 0):

  • Removed stale biome-ignore comments in bootstrap.ts, r3f.d.ts, and parametric-node-renderer.tsx — the rules they were suppressing no longer fire in those positions, so the suppressions themselves were the lint errors (suppressions/unused).
  • Replaced two forEach callbacks that returned values with for...of loops (node-actions.ts, build-collider-world.ts) — fixes useIterableCallbackReturn.
  • Rewrote x && (x.foo = false) short-circuit-assignment guards in ceiling/tool.tsx as explicit if statements — fixes noAssignInExpressions.
  • Hoisted a useMemo/useCallback pair above an early return null in chimney/panel.tsx — fixes useHookAtTopLevel.

Types (32 errors → 0):

The 32 type errors all reproduce on a fresh checkout but disappear once packages/core is built — the symbols (useAlignmentGuides, AlignmentAnchor, bboxAnchors, resolveAlignment, TranslateHandle, ParamAction, GutterNode, plus the various missing handle/event properties and PaintableMaterialTarget variants) all exist in packages/core/src/ and are re-exported through the package barrels. The published dist/ was just stale, and consumers resolve types via dist (per the package's exports field with moduleResolution: "bundler").

The fix is a single turbo.json change: check-types now dependsOn: ["^build", "^check-types"] so internal builds run before type-checks. No @ts-ignore, no as any, no consumer code changes needed.

Verification

  • bun run check — 0 errors, 0 warnings (101 non-blocking useExhaustiveDependencies infos remain at info level per existing config — those don't fail CI).
  • bun run check-types — 0 errors across all 9 typed projects.

Out of scope

  • The useExhaustiveDependencies infos in viewer/index.tsx, door-system.tsx, geometry-system.tsx, window-system.tsx, etc. — they're warnings/infos not errors, and fixing them properly needs more familiarity with each component than this PR should take on.
  • packages/mcp already has its own mcp-ci.yml workflow with build + test + biome on path-filtered changes; this new general workflow runs alongside it.

- Remove stale biome-ignore suppressions in bootstrap.ts, r3f.d.ts,
  and parametric-node-renderer.tsx (rules no longer fire).
- Replace forEach callbacks that return values with for...of loops
  in node-actions.ts and build-collider-world.ts
  (lint/suspicious/useIterableCallbackReturn).
- Rewrite assign-in-expression guards in ceiling/tool.tsx to explicit
  if-statements (lint/suspicious/noAssignInExpressions).
- Hoist useMemo/useCallback above early return in chimney/panel.tsx
  (lint/correctness/useHookAtTopLevel).
- Add `^build` to turbo check-types dependsOn so packages/core dist is
  up-to-date before type checking — this resolves all 32 type errors
  which were caused by stale dist, not missing symbols.
Adds a quality gate that runs `bun run check` (Biome) and
`bun run check-types` (TypeScript) on every push and PR to main.
Uses concurrency groups to cancel stale runs. Closes #147.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CI workflow for lint + typecheck on push/PR

2 participants